﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace MyWeb.Admin
{
    public partial class ChangePass : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            txtUsername.Text = Page.User.Identity.Name;
            lbtBackT.Attributes.Add("onClick", "javascript:history.back(); return false;");
            lbtBackB.Attributes.Add("onClick", "javascript:history.back(); return false;");
            ltrMessage.Text = "";
        }

        protected void Update_Click(object sender, EventArgs e)
        {
            if (Common.StringClass.Check(txtPassword.Text)){
                Business.UserService.User_ChangePass(Page.User.Identity.Name, Common.StringClass.Encrypt(txtPassword.Text));
                ltrMessage.Text = "Mật khẩu đã được thay đổi!";
                //Response.Redirect(Common.GlobalClass.GetUrlAdmin());
            }
        }
    }
}